
<div id="main-content">
  <div class="container-fluid">
    <ul class="breadcrumb">
      <li><a href="<?php print site_url("frm/accounting/journal")?>"><?php print lang('frm_journal')?></a><span class="divider">»</span></li>
      <li><a href="<?php print site_url("frm/accounting/journal-log/".$id_frm_journal)?>"><?php print lang('frm_journal_transaksi')?></a><span class="divider">»</span></li>
      <li><a href="<?php print site_url("frm/accounting/all-buku-besar/".$id_frm_journal)?>"><?php print lang('frm_buku_besar')?></a><span class="divider">»</span></li>
      <li><a href="<?php print site_url("frm/accounting/neraca/".$id_frm_journal)?>"><?php print lang('frm_neraca')?></a><span class="divider">»</span></li>
      <li class="active"><?php print $title?></li>
    </ul>
    <div class="row-fluid">
      <div class="span12">
        <div class="widget-block">
          <?php
          if($status == '2'){
          ?>
          <div class="alert alert-error fade in">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <strong><?php print urldecode($pesan)?></strong>
          </div>
          <?php
          }
          if($status == '1'){
          ?>
          <div class="alert alert-success fade in">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <strong><?php print urldecode($pesan)?></strong>
          </div>
          <?php
          }
          ?>
          <div class="widget-head">
            <h5><?php print $title?></h5>
            <div class="widget-control pull-right">
              <a href="#" data-toggle="dropdown" class="btn dropdown-toggle"><i class="icon-cog"></i><b class="caret"></b></a>
              <ul class="dropdown-menu">
                <?php
                if($this->global_models->get_field("frm_journal", "status", array("id_frm_journal" => $id_frm_journal)) == 1)
                  print "<li><a href='".site_url("frm/accounting/add-journal-transaksi-penyesuaian/".$id_frm_journal)."'><i class='icon-plus'></i>".lang("add_frm_journal_transaksi_penyesuaian")."</a></li>";
                ?>
                <li><a href="<?php print   site_url("frm/accounting/journal-log-penyesuaian/".$id_frm_journal) ?>"><i class="icon-plus"></i><?php print lang("frm_journal_penyesuaian")?></a></li>
                <li><a href="<?php print   site_url("frm/accounting/neraca-setelah-penyesuaian/".$id_frm_journal) ?>"><i class="icon-plus"></i><?php print lang("frm_neraca_setelah_penyesuaian")?></a></li>
<!--                <li><a href="<?php print   site_url("frm/accounting/work-sheet/".$id_frm_journal) ?>"><i class="icon-plus"></i><?php print lang("frm_work_sheet")?></a></li>-->
              </ul>
            </div>
          </div>
          <div class="widget-content">
            <div class="widget-box">
              <table class="table">
                <thead style="background-color: rgba(128, 128, 128, 0.33);">
                  <tr>
                    <th>No Akun</th>
                    <th colspan="2">Name</th>
                    <th>Debit</th>
                    <th>Kredit</th>
                  </tr>
                </thead>
                <tbody>
                  <?php
                  if(is_array($data)){
                    foreach ($data as $key => $value) {
                      $link_edit = site_url("frm/accounting/add-master-account/".$value->id_frm_account);
//                      $link_delete = site_url("keuangan/add-akun/".$outlet[0]->id_outlet."/".$value->id_akun);
                      
                      if($value->pos_counter == 1){
                        $name_debit = "<a href='".site_url("frm/accounting/buku-besar/".$id_frm_journal."/".$value->id_frm_account)."'>".$value->title."</a>";
                        $name_kredit = "";
                        $price_debit = "Rp ".number_format($value->price, 0, ",",".");
                        $price_kredit = "";
                        $total_debit += $value->price;
                      }
                      else{
                        $name_debit = "";
                        $name_kredit = "<a href='".site_url("frm/accounting/buku-besar/".$id_frm_journal."/".$value->id_frm_account)."'>".$value->title."</a>";
                        $price_debit = "";
                        $price_kredit = "Rp ".number_format($value->price, 0, ",",".");
                        $total_kredit += $value->price;
                      }
                        
                      print "
                  <tr>
                    <td>{$value->nomor}</td>
                    <td>{$name_debit}</td>
                    <td>{$name_kredit}</td>
                    <td style='text-align: right;'>{$price_debit}</td>
                    <td style='text-align: right;'>{$price_kredit}</td>
                  </tr>"
                  ;
                    }
                  }
                  ?>
                </tbody>
                <tfoot style="font-weight: bold; background-color: rgba(128, 128, 128, 0.33);">
                  <tr>
                    <td colspan="3" style="text-align: center">JUMLAH</td>
                    <td style="text-align: right">Rp <?php print number_format($total_debit, 0, ",", ".")?></td>
                    <td style="text-align: right">Rp <?php print number_format($total_kredit, 0, ",", ".")?></td>
                  </tr>
                </tfoot>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>